package eco.footprint;

import android.os.Parcel;
import android.os.Parcelable;

public class FootprintResult implements Parcelable{

	double numberOfEarths = 0;

	double foodTotal = 0;
	double shelterTotal = 0;
	double mobilityTotal = 0;
	double goodsTotal = 0;
	double servicesTotal = 0;
	double governanceTotal = 0;

	double energyTotal = 0;
	double cropTotal = 0;
	double grazTotal = 0;
	double forestTotal = 0;
	double builtTotal = 0;
	double fishTotal = 0;

	public FootprintResult(Parcel in) {
		 numberOfEarths = in.readDouble();
		 foodTotal = in.readDouble();
		 shelterTotal = in.readDouble();
		 mobilityTotal = in.readDouble();
		 goodsTotal = in.readDouble();
		 servicesTotal = in.readDouble();
		 governanceTotal = in.readDouble();
		 energyTotal = in.readDouble();
		 cropTotal = in.readDouble();
		 grazTotal = in.readDouble();
		 forestTotal = in.readDouble();
		 builtTotal = in.readDouble();
		 fishTotal = in.readDouble();
	}

	public FootprintResult() {
		// TODO Auto-generated constructor stub
	}

	public double totalScore() {
		return foodTotal + shelterTotal + mobilityTotal + goodsTotal
				+ servicesTotal + governanceTotal;
	}

	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		
		dest.writeDouble(numberOfEarths);

		dest.writeDouble(foodTotal);
		dest.writeDouble(shelterTotal);
		dest.writeDouble(mobilityTotal);
		dest.writeDouble(goodsTotal);
		dest.writeDouble(servicesTotal);
		dest.writeDouble(governanceTotal);

		dest.writeDouble(energyTotal);
		dest.writeDouble(cropTotal);
		dest.writeDouble(grazTotal);
		dest.writeDouble(forestTotal);
		dest.writeDouble(builtTotal);
		dest.writeDouble(fishTotal);
	}
	
	   public static final Parcelable.Creator<FootprintResult> CREATOR = new Parcelable.Creator<FootprintResult>() {
		public FootprintResult createFromParcel(Parcel in) {
			return new FootprintResult(in);
		}

		public FootprintResult[] newArray(int size) {
			return new FootprintResult[size];
		}
	};
}
